package com.yanqu.road.server.cmd.activity.xingyoushanshui;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.XingYouShanShuiProto;
import com.yanqu.road.server.cmd.CrossUnionCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouActivity;
import com.yanqu.road.server.manager.activity.xingyou.CrossXingYouShanShuiMgr;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_XING_YOU_SHAN_SHUI_CATCH_REWARD, desc = "衙门司领奖")
public class CrossShanShauiYamenRewardCmd extends CrossUnionCommand {

    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        XingYouShanShuiProto.ShanShuiYamenRewardReq req = XingYouShanShuiProto.ShanShuiYamenRewardReq.parseFrom(packet.getBytes());
        int activityId = req.getActivityId();
        CrossXingYouActivity activity = CrossXingYouShanShuiMgr.getActivity(activityId, groupId);
        if(activity != null){
            activity.yamenReward(serverId, packet.getPlayerId());
        }
    }

    @Override
    public void sendData() {

    }
}
